<script>
import {defineComponent} from 'vue'
import Child from "@/components/Child.vue";

export default defineComponent({
    name: "App",
    components: {Child},
    data(){
        return {
            num:10
        }
    },
    methods:{
        fn(v){
            this.num=v;
        }
    }
})
</script>

<template>
    <div>
        <h3>App|{{num}}</h3>
        <hr/>
        <Child :num.sync="num"/>
        <hr/>
        <!-- 相当于：-->
        <Child :num="num" @update:num="fn"/>
    </div>
</template>

<style scoped>

</style>